using System;
using Mistral.Utils;

namespace DeclarativeTest.Core.Support
{
	//todo: move to mistral
	public static class ReflectionExtensions
	{
		public static bool Is<T>( this Type type )
		{
			return typeof(T).IsAssignableFrom( type ) && !type.IsInterface;
		}

		public static bool Implements<T>( this Type type )
		{
			return typeof(T).IsAssignableFrom( type ) && !type.IsAbstract;
		}

		public static T GetAttribute<T>( this Type type ) where T : Attribute
		{
			return ReflectionUtils.GetAttribute<T>( type );
		}
	}
}